@import "../../pretixbase/scss/_variables.scss";
@import "../../bootstrap/scss/bootstrap/variables";
@import "../../bootstrap/scss/bootstrap/mixins";

.pretix-widget-hidden {
  display: none;
}
.pretix-widget, .pretix-widget-alert-box {
  a {
    color: $link-color;
    text-decoration: none;

    &:hover,
    &:focus {
      color: $link-hover-color;
      text-decoration: $link-hover-decoration;
    }
    &:focus {
      outline: thin dotted;
      outline: 5px auto -webkit-focus-ring-color;
      outline-offset: -2px;
    }
  }
  img {
    border: 0;
  }
  b, strong {
    font-weight: bold;
  }
  h3 {
    font-size: $font-size-h3;
    font-weight: bold;
    padding: 0 15px;
  }
  button, input[type="button"] {
    overflow: visible;
    text-transform: none;
    cursor: pointer;
    display: inline-block;
    margin-bottom: 0;
    text-align: center;
    vertical-align: middle;
    touch-action: manipulation;
    background-image: none;
    border: 1px solid transparent;
    white-space: nowrap;
    @include button-size($padding-base-vertical, $padding-base-horizontal, $font-size-base, $line-height-base, $btn-border-radius-base);
    @include user-select(none);
    @include button-variant($btn-primary-color, $btn-primary-bg, $btn-primary-border);

    &,
    &:active,
    &.active {
      &:focus,
      &.focus {
        @include tab-focus;
      }
    }
    &.disabled,
    &[disabled],
    fieldset[disabled] & {
      cursor: $cursor-disabled;
      @include opacity(.65);
      @include box-shadow(none);
    }
  }
  input[type="text"], input[type="number"] {
    line-height: normal;
    border: 1px solid $input-border;
    border-radius: $input-border-radius;
    height: $input-height-base;
    padding: $padding-base-vertical $padding-base-horizontal;
    color: $input-color;
    background-color: $input-bg;
    @include box-shadow(inset 0 1px 1px rgba(0, 0, 0, .075));
    @include transition(border-color ease-in-out .15s, box-shadow ease-in-out .15s);
    @include placeholder;
    $color-rgba: rgba(red($input-border-focus), green($input-border-focus), blue($input-border-focus), .6);

    &:focus {
      border-color: $input-border-focus;
      outline: 0;
      @include box-shadow(inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px $color-rgba);
    }
  }
  input[type="checkbox"],
  input[type="radio"] {
    box-sizing: border-box; // 1
    padding: 0; // 2
    &:focus {
      outline: thin dotted;
      outline: 5px auto -webkit-focus-ring-color;
      outline-offset: -2px;
    }
  }
}
.pretix-widget {
  margin: 10px 0;
  padding: 0 10px;
  border: 1px solid #ccc;
  position: relative;
  min-height: 208px;
  border-radius: $input-border-radius;

  .pretix-widget-resume-button {
    float: right;
    margin-left: 10px;
  }

  .pretix-widget-clickable {
    cursor: pointer;
  }

  .pretix-widget-info-message {
    padding: 10px;
    text-align: left;
    margin: 10px 0;
    background-color: white;
    border: 2px solid $brand-info;
    color: $brand-info;
    border-radius: $alert-border-radius;
  }

  .pretix-widget-error-message {
    padding: 10px;
    text-align: center;
    margin: 10px 0;
    background-color: white;
    border: 2px solid $brand-danger;
    color: $brand-danger;
    border-radius: $alert-border-radius;
  }

  .pretix-widget-loading {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, .8);
    text-align: center;
  }

  @-moz-keyframes pretix-widget-spin {
    100% {
      -moz-transform: rotate(360deg);
    }
  }

  @-webkit-keyframes pretix-widget-spin {
    100% {
      -webkit-transform: rotate(360deg);
    }
  }

  @keyframes pretix-widget-spin {
    100% {
      -webkit-transform: rotate(360deg);
      transform: rotate(360deg);
    }
  }

  .pretix-widget-loading svg {
    margin: 40px;
    -webkit-animation: pretix-widget-spin 6s linear infinite;
    -moz-animation: pretix-widget-spin 6s linear infinite;
    animation: pretix-widget-spin 6s linear infinite;
  }

  .pretix-widget-item-row, .pretix-widget-category {
    clear: both;
  }

  .pretix-widget-item-title {
    font-weight: bold;
  }

  .pretix-widget-item-row {
    padding: 10px 0;
  }

  .pretix-widget-category {
    margin: 10px 0;
  }

  .pretix-widget-category-description {
    padding: 0 15px;
  }

  .pretix-widget-category-name {
    margin: 10px 0 0 0;
  }

  .pretix-widget-item-info-col {
    width: 50%;
    float: left;
    padding: 0 15px;
    box-sizing: border-box;
  }

  .pretix-widget-item-price-col, .pretix-widget-item-availability-col {
    width: 25%;
    float: left;
    padding: 0 15px;
    box-sizing: border-box;
  }

  .pretix-widget-item-description p, .pretix-widget-item-meta {
    margin: 0;
  }

  .pretix-widget-item-price-col {
    text-align: right;
  }

  del.pretix-widget-pricebox-original-price {
    color: $text-muted;
  }

  ins.pretix-widget-pricebox-new-price {
    font-size: 120%;
    font-weight: bold;
    text-decoration: none;
  }

  .pretix-widget-clear {
    clear: both;
  }

  .pretix-widget-category-description p {
    margin: 0 0 10px;
  }

  .pretix-widget-pricebox-tax {
    display: block;
  }

  .pretix-widget-item-count-multiple {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 5px;
    text-align: center;
  }

  .pretix-widget-pricebox-price-input {
    display: inline;
    width: 100px;
    box-sizing: border-box;
    text-align: right;
  }

  .pretix-widget-item-count-single-label {
    display: block;
    text-align: center;
    width: 100%;
  }

  .pretix-widget-attribution {
    padding: 10px 15px;
    text-align: center;
    font-size: 12px;
  }

  .pretix-widget-item-picture {
    width: 60px;
    height: 60px;
    margin-right: 10px;
    float: left;
  }

  .pretix-widget-action {
    margin-left: 75%;
    width: 25%;
    padding: 0 15px;
    box-sizing: border-box;
  }

  .pretix-widget-action button {
    width: 100%;
  }

  .pretix-widget-voucher-headline {
    margin: 10px 0 0 0;
  }
  .pretix-widget-voucher-text {
    margin: 10px 0;
    padding: 0 15px;
  }

  .pretix-widget-voucher-input-wrap {
    padding: 0 15px;
    width: 75%;
    box-sizing: border-box;
    float: left;
  }

  .pretix-widget-voucher input {
    width: 100%;
    box-sizing: border-box;
  }

  .pretix-widget-voucher-button-wrap {
    padding: 0 15px;
    width: 25%;
    box-sizing: border-box;
    float: left;
  }

  .pretix-widget-voucher button {
    width: 100%;
  }

  .pretix-widget-item-with-picture .pretix-widget-main-item-row .pretix-widget-item-title-and-description {
    margin-left: 70px;
  }

  .pretix-widget-item-availability-col {
    text-align: center;
  }

  .pretix-widget-availability-gone {
    font-weight: bold;
    color: $brand-danger;
    text-transform: uppercase;
  }

  .pretix-widget-availability-unavailable {
    color: $brand-danger;
  }

  .pretix-widget-item-variations {
    overflow: hidden;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    -moz-transition-duration: 0.5s;
    -webkit-transition-duration: 0.5s;
    -o-transition-duration: 0.5s;
    transition-duration: 0.5s;
    -moz-transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
    -webkit-transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
    -o-transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
    transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
  }

  .pretix-widget-item-variations-expanded {
    -moz-transition-duration: 0.5s;
    -webkit-transition-duration: 0.5s;
    -o-transition-duration: 0.5s;
    transition-duration: 0.5s;
    -moz-transition-timing-function: ease-in;
    -webkit-transition-timing-function: ease-in;
    -o-transition-timing-function: ease-in;
    transition-timing-function: ease-in;
    max-height: 10000px;
    overflow: hidden;
  }
  .pretix-widget-event-header {
    padding-top: 10px;
    text-align: center;
  }
  .pretix-widget-event-details {
    padding-top: 10px;
    text-align: center;
  }
  .pretix-widget-event-description {
    padding: 0 15px;
  }
  .pretix-widget-event-list-back {
    padding-top: 10px;
    text-align: center;
    display: block;
    a {
      display: block;
    }
  }
  .pretix-widget-back {
    padding-bottom: 10px;
    text-align: center;
    display: block;
    a {
      display: block;
    }
  }

  .pretix-widget-event-list {
    padding: 10px 0;
    cursor: pointer;
  }
  .pretix-widget-event-list-entry {
    display: flex;
    flex-direction: row;
    padding: 5px 0;
    flex-wrap: wrap;
    color: $text-color;

    &:hover, &:active, &:focus {
      background: $gray-lighter;
      text-decoration: none;
    }

    .pretix-widget-event-list-entry-name {
      width: 50%;
      padding: 5px;
      box-sizing: border-box;
    }
    .pretix-widget-event-list-entry-location {
      padding: 5px;
      box-sizing: border-box;
      display: none;
    }
    .pretix-widget-event-list-entry-date {
      width: 25%;
      padding: 5px;
      box-sizing: border-box;
    }
    .pretix-widget-event-list-entry-availability {
      width: 25%;
      text-align: right;
      padding: 7px 5px 3px;
      box-sizing: border-box;
      span {
        display: inline;
        padding: 2px 6px 3px;
        font-size: 75%;
        font-weight: bold;
        line-height: 1;
        color: #fff;
        text-align: center;
        white-space: nowrap;
        vertical-align: baseline;
        border-radius: 4px;
      }
    }
  }

  .pretix-widget-event-availability-orange .pretix-widget-event-list-entry-availability span,
  .pretix-widget-event-availability-orange.pretix-widget-event-calendar-event {
    background-color: $brand-warning;
  }
  .pretix-widget-event-availability-none .pretix-widget-event-list-entry-availability span,
  .pretix-widget-event-availability-none.pretix-widget-event-calendar-event {
    background-color: $brand-primary;
  }
  .pretix-widget-event-availability-green .pretix-widget-event-list-entry-availability span,
  .pretix-widget-event-availability-green.pretix-widget-event-calendar-event {
    background-color: $brand-success;
  }
  .pretix-widget-event-availability-red .pretix-widget-event-list-entry-availability span,
  .pretix-widget-event-availability-red.pretix-widget-event-calendar-event {
    background-color: $brand-danger;
  }

  .pretix-widget-event-calendar {
    padding-top: 10px;
    word-break: break-word;

    .pretix-widget-event-week-table {
      display: flex;
      flex-direction: row;

      .pretix-widget-event-week-col {
        flex: 1;
        margin: 0 5px;

        &:first-child {
          margin-left: 0;
        }
        &:last-child {
          margin-right: 0;
        }
      }
    }

    .pretix-widget-event-calendar-head {
      display: flex;
      flex-direction: row;

      strong {
        width: 50%;
        text-align: center;
        display: block;
      }
      .pretix-widget-event-calendar-next-month, .pretix-widget-event-calendar-previous-month {
        display: block;
        width: 25%;
      }
      .pretix-widget-event-calendar-next-month {
        text-align: right;
      }
    }
    .pretix-widget-event-calendar-event {
      display: block;
      border-radius: 4px;
      padding: 5px;
      color: white;
      cursor: pointer;
      margin-bottom: 5px;
      &:last-child {
        margin-bottom: 0;
      }
      &:hover {
        text-decoration: none;
      }
    }

    .pretix-widget-event-calendar-table {
      width: 100%;

      th, td {
        width: 14.285714285714286%;
        vertical-align: top;
        padding: 10px 5px;
      }
    }
    .pretix-widget-event-calendar-day {
      font-weight: bold;
    }
  }

  .pretix-widget-seating-link-wrapper {
    padding: 0 15px;
    margin: 15px 0 10px;
  }
  .pretix-widget-seating-link {
    display: block;
    width: 100%;
  }
}

@keyframes pretix-widget-bounce-in {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.5);
  }
  100% {
    transform: scale(1);
  }
}
.pretix-widget-alert-holder {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  z-index: 16777271;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.5s;  /* do not animate visibility or we'll have a flashing thing on load */

  &.pretix-widget-alert-shown {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.5s, visibility 0.5s;
  }

  .bounce-enter-active {
    animation: pretix-widget-bounce-in .5s;
  }
  .bounce-leave-active {
    animation: pretix-widget-bounce-in .5s reverse;
  }

  .pretix-widget-alert-box {
    position: fixed;
    left: 50%;
    width: 600px;
    margin-left: -300px;
    top: 100px;
    background: white;
    border-radius: 5px 5px 5px 5px;
    -moz-border-radius: 5px 5px 5px 5px;
    -webkit-border-radius: 5px 5px 5px 5px;
    box-shadow: 0 4px 18px 0 rgba(0, 0, 0, 0.1), 0 6px 20px 0 rgba(0, 0, 0, 0.09);
    -webkit-box-shadow: 0 4px 18px 0 rgba(0, 0, 0, 0.1), 0 6px 20px 0 rgba(0, 0, 0, 0.09);
    -moz-box-shadow: 0 4px 18px 0 rgba(0, 0, 0, 0.1), 0 6px 20px 0 rgba(0, 0, 0, 0.09);
    box-sizing: border-box;
    padding: 42px 20px 20px 20px;
    text-align: center;
    font-size: 20px;

    p:first-child {
      margin-top: 0;
    }
    p:last-child {
      margin-bottom: 0;
    }
  }
  .pretix-widget-alert-icon {
    position: fixed;
    left: 50%;
    width: 64px;
    margin-left: -32px;
    top: 68px;
  }
}
.pretix-widget-frame-holder {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  z-index: 16777271;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.5s, visibility 0.5s;

  .pretix-widget-frame-loading {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    position: fixed;
    left: 0;
    top: 0;
  }

  .pretix-widget-frame-loading svg {
    margin: 40px;
    -webkit-animation: pretix-widget-spin 6s linear infinite;
    -moz-animation: pretix-widget-spin 6s linear infinite;
    animation: pretix-widget-spin 6s linear infinite;
  }

  &.pretix-widget-frame-shown {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.5s, visibility 0.5s;
  }

  .pretix-widget-frame-inner {
    position: fixed;
    left: 10%;
    width: 80%;
    height: 80%;
    top: 10%;
    background: white;
    border-radius: 5px 5px 5px 5px;
    -moz-border-radius: 5px 5px 5px 5px;
    -webkit-border-radius: 5px 5px 5px 5px;
    box-shadow: 0 4px 18px 0 rgba(0, 0, 0, 0.1), 0 6px 20px 0 rgba(0, 0, 0, 0.09);
    -webkit-box-shadow: 0 4px 18px 0 rgba(0, 0, 0, 0.1), 0 6px 20px 0 rgba(0, 0, 0, 0.09);
    -moz-box-shadow: 0 4px 18px 0 rgba(0, 0, 0, 0.1), 0 6px 20px 0 rgba(0, 0, 0, 0.09);
    box-sizing: border-box;
    padding: 10px;
  }

  .pretix-widget-frame-close {
    position: fixed;
    right: 10%;
    top: 10%;
    width: 24px;
    height: 24px;
    background: $brand-primary;
    margin: -12px -12px 0 0;
    border-radius: 12px;
    -moz-border-radius: 12px;
    -webkit-border-radius: 12px;
    text-align: center;
  }

  .pretix-widget-frame-close a {
    color: white;
    font-weight: bold;
    font-family: sans-serif;
    text-decoration: none;
    padding: 4px 0;
    display: block;
  }

  .pretix-widget-frame-inner iframe {
    width: 100% !important;
    height: 100% !important;
  }
}

.pretix-widget-primary-color {
  /* in SVG */
  fill: $brand-primary;
}

.pretix-widget.pretix-widget-mobile {
  .pretix-widget-event-week-table {
    display: block;

    .pretix-widget-event-week-col {
      flex: 1;
      margin: 10px 0;
    }
  }

  .pretix-widget-item-info-col {
    width: 100%;
    float: none;
    margin-bottom: 5px;
  }
  .pretix-widget-item-price-col, .pretix-widget-item-availability-col {
    width: 50%;
  }
  .pretix-widget-action {
    width: 100%;
    margin-left: 0;
  }
  .pretix-widget-voucher-input-wrap {
    width: 100%;
    float: none;
  }
  .pretix-widget-voucher-button-wrap {
    width: 100%;
    float: none;
    margin-top: 10px;
  }

  .pretix-widget-event-list-entry {
    .pretix-widget-event-list-entry-name {
      width: 100%;
    }
    .pretix-widget-event-list-entry-location {
      width: 100%;
    }
    .pretix-widget-event-list-entry-date {
      width: 50%;
    }
    .pretix-widget-event-list-entry-availability {
      width: 50%;
    }
  }

  .pretix-widget-event-calendar {
    .pretix-widget-event-calendar-events {
      display: none;
    }
    .pretix-widget-event-week-table {
      .pretix-widget-event-calendar-events {
        display: block;
      }
    }
    td.pretix-widget-has-events {
      background: $brand-primary;
      color: white;
      cursor: pointer;
      &.pretix-widget-day-availability-red {
        background: $brand-danger;
      }
      &.pretix-widget-day-availability-green {
        background: $brand-success;
      }
      &.pretix-widget-day-availability-orange {
        background: $brand-warning;
      }
    }

    .pretix-widget-event-calendar-head {
      display: block;
      strong {
        width: 100%;
        display: block;
      }
      .pretix-widget-event-calendar-next-month, .pretix-widget-event-calendar-previous-month {
        display: block;
        width: 100%;
        text-align: center;
      }
    }
  }
}

@media (min-width: 1200px) {
  .pretix-widget-frame-holder {
    .pretix-widget-frame-inner {
      left: 50%;
      margin-left: -540px;
      width: 1080px;
    }
    .pretix-widget-frame-close {
      left: 50%;
      margin-left: 528px;
    }
  }
}

@media (max-width: 800px) {
  .pretix-widget-frame-holder .pretix-widget-frame-inner {
    left: 0;
    width: 100%;
    height: 100%;
    top: 0;
    background: $brand-primary;
    border-radius: 0;
    -moz-border-radius: 0;
    -webkit-border-radius: 0;
    box-shadow: none;
    -webkit-box-shadow: none;
    -moz-box-shadow: none;
    padding: 40px 0 0 0;
  }
  .pretix-widget-frame-holder .pretix-widget-frame-close {
    right: 20px;
    top: 20px;
    background: white;
    svg path {
      fill: $brand-primary;
    }
  }
}

// https://github.com/Akryum/vue-resize/blob/master/dist/vue-resize.css
.resize-observer[data-v-b329ee4c]{position:absolute;top:0;left:0;z-index:-1;width:100%;height:100%;border:none;background-color:transparent;pointer-events:none;display:block;overflow:hidden;opacity:0}.resize-observer[data-v-b329ee4c] object{display:block;position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1}
